Log : EdgerOS system log

更新时间:
2024-05-15
下载文档

Log : EdgerOS system log

This module provides a unified interface for EdgerOS operating system event log recording. System privileged apps and services can record important system operation logs through this interface. This module is provided in EdgerOS 2.1.4 and later.

User can use the following code to import the log module.

var log = require('eos/log');

Support

The following shows log module APIs available for each permissions.

 User ModePrivilege Mode
log.info 
log.warn 
log.error 

Log Object

log.info(id, acoid, info[, extra])

  • id {String} Event type ID.
  • acoid {String} Operating account. Optional.
  • info {String} Event information.
  • extra {String} Other additional information. Optional.

Record a system Informaton type log. id specifies the type ID of this event, each type of event should use the same ID.

log.warn(id, acoid, info[, extra])

  • id {String} Event type ID.
  • acoid {String} Operating account. Optional.
  • info {String} Event information.
  • extra {String} Other additional information. Optional.

Record a system Warning type log. id specifies the type ID of this event, each type of event should use the same ID.

log.error(id, acoid, info[, extra])

  • id {String} Event type ID.
  • acoid {String} Operating account. Optional.
  • info {String} Event information.
  • extra {String} Other additional information. Optional.

Record a system Error type log. id specifies the type ID of this event, each type of event should use the same ID.

文档内容是否对您有所帮助?
有帮助
没帮助